package com.leoman.dao;

import com.leoman.entity.Image;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * ImageDao
 * Created by 涂奕恒 on 2016/11/23 0023 下午 3:43.
 */
public interface ImageDao extends JpaRepository<Image, Integer>, JpaSpecificationExecutor<Image> {

    @Query("select a from Image a where a.sourceId = ?1 and a.sourceType = ?2")
    List<Image> findListByParams(Integer sourceId, Integer sourceType);
}